/*
 * @Author: hongbin
 * @Date: 2022-11-03 17:48:42
 * @LastEditors: hongbin
 * @LastEditTime: 2022-12-22 13:46:35
 * @Description:api 常用函数
 */

/**
 * 验证字段是否充足
 */
export const VerifyFields = {
    /**
     * 目标对象中是否有某属性或某几个属性
     */
    has: (obj: Record<string, any>, properties: string | string[]) => {
        if (typeof properties === "string") return !!obj[properties];
        // return properties.every((property) => Object.hasOwn(obj, property));
        return properties.every((property) => typeof obj[property] != undefined);
    },
};
